{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "1fcf8825",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.4691865 s\n",
      "0.4233791 s 423.3791 ms\n",
      "0.4240865707397461 s 424.0865707397461 ms\n"
     ]
    }
   ],
   "source": [
    "import cv2 as cv\n",
    "import time\n",
    "\n",
    "img1 = cv.imread('data/messi5.jpg')\n",
    "e1 = cv.getTickCount()\n",
    "for i in range(5,49,2):\n",
    "    img1 = cv.medianBlur(img1,i)\n",
    "e2 = cv.getTickCount()\n",
    "t = (e2 - e1)/cv.getTickFrequency()\n",
    "print( t, 's' )\n",
    "\n",
    "t1 = time.time()\n",
    "e1 = cv.getTickCount()\n",
    "for i in range(5,49,2):\n",
    "    img1 = cv.medianBlur(img1,i)\n",
    "e2 = cv.getTickCount()\n",
    "tt = (e2 - e1)/cv.getTickFrequency()\n",
    "t2 = time.time()\n",
    "t = t2 - t1\n",
    "print( tt, 's', tt*1000, 'ms' )\n",
    "print( t, 's', t*1000, 'ms'  )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "10af58ed",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "10e9db33",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
